Skip to content

Query Hooks Improvements - #5681

Merged
greenbonebot merged 36 commits into
mainfrom
query-hooks-improvements
Oct 7, 2026
Merged

greenbonebot merged 36 commits into
mainfrom
query-hooks-improvements

Conversation

@bjoernricks

@bjoernricks bjoernricks commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What

Query Hooks Improvements

Extend and improve the query hooks to make them consistent.

Why

We should have one dedicated API for querying data. This means we should get rid of

  • The redux store completely
  • Using the GMP API in interface components

Checklist

  • I have added tests for the changes
  • I have used the following LLMs/AI tools in this pull request:

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 0525f98.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@bjoernricks
bjoernricks force-pushed the query-hooks-improvements branch from cfe5a3d to 78fd148 Compare October 7, 2026 05:50
@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.97468% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.68%. Comparing base (f75b757) to head (0525f98).

Files with missing lines Patch % Lines
src/web/hooks/use-query/agent.ts 80.00% 5 Missing ⚠️
src/web/pages/portlists/PortListComponent.tsx 91.66% 2 Missing ⚠️
src/web/pages/users/UserComponent.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5681      +/-   ##
==========================================
+ Coverage   87.60%   87.68%   +0.07%     
==========================================
  Files        1306     1322      +16     
  Lines       34302    34437     +135     
  Branches    10295    10329      +34     
==========================================
+ Hits        30051    30195     +144     
+ Misses       3844     3837       -7     
+ Partials      407      405       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Use dedicated modules for single and multiple entity query hooks.
Use dedicated modules for single and multiple entity query hooks.
Ensure when cloning and deleting tickets via their query hooks a
notification message is displayed.
Use dedicated describe blocks for each hook and use real model instances
in the tests.
Ensure when cloning and deleting users via their query hooks a
notification message is displayed.
Allow to query Target data via use query hooks.
As query hooks might not return a response object and instead the data
directly the goToDetails function needs to support this use case.
Refactor TargetComponent to use the new query hooks for target.
Before the changed port list was re-loaded after a port range was
deleted. This is completely unnecessary and also created several
additional requests when a user deleted several port ranges in the
dialog.
Allow to query and mutate port lists via query hooks.
Use the new port list query hooks within the PortListComponent.
Implement the basic set of query hooks for credentials.
Update TargetComponent and TargetDialog to use the new port list and
credential query hooks internally instead of directly querying the gmp
API.
Entity and entities queries are separated everywhere else already.
For deleting a user an additional input argument is required.
…ssage

Ensure that the name argument is passed by default and the type checker
complains about it. This ensure the success message is displayed
correctly.
Use useDeleteMutation and adapt arguments to recent changes.
One for tag and one for tags queries.
One for agent and one for agents queries.
All save methods of commands should just return a Promise<void> because
it just updates the current entity.
This new interface will be re used in a query hook.
Always behave the same for all single entity query hooks. Clone and
create return EntityActionData. Save and delete just return void.
@bjoernricks
bjoernricks force-pushed the query-hooks-improvements branch from f73daf8 to d95c145 Compare October 7, 2026 07:51
@bjoernricks
bjoernricks marked this pull request as ready for review October 7, 2026 07:52
@bjoernricks
bjoernricks requested a review from a team as a code owner October 7, 2026 07:52
@greenbonebot
greenbonebot enabled auto-merge (rebase) October 7, 2026 07:52
Comment thread src/web/pages/portlists/PortListComponent.tsx
Show success message and don't call onImported and onImportError
handlers twice.
Comment thread public/locales/gsa-it.json Outdated
Co-authored-by: Daniele Mangiagli <daniele.mangiagli@greenbone.net>
@greenbonebot
greenbonebot merged commit 175b640 into main Oct 7, 2026
37 of 40 checks passed
@greenbonebot
greenbonebot deleted the query-hooks-improvements branch October 7, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants